<template>
  <el-dialog :title="title" :visible.sync="visible" width="1300px" append-to-body>
    <div class="app-container">
      <el-table v-loading="loading" :data="tableData">
        <el-table-column width="250" label="目的地地接社" align="center" prop="bournReception">

        </el-table-column>
        <el-table-column width="80" label="目的地" align="center" prop="bourn">
        </el-table-column>
        <el-table-column width="100" label="联系人" align="center" prop="linkman">
        </el-table-column>
        <el-table-column width="150" label="电话" align="center" prop="linktel">
        </el-table-column>
        <el-table-column width="180" label="许可证" align="center" prop="licence"/>
        <el-table-column width="180" label="详细地址" align="center" prop="locationInfo"/>
        <el-table-column width="80" label="状态" align="center" prop="state">
          <template slot-scope="scope">
            {{ scope.row.state == 0 ? '历史' : '在用' }}
          </template>
        </el-table-column>
        <el-table-column width="150" label="修改人" align="center" prop="createUserName"/>
        <el-table-column width="170" label="修改时间" align="center" prop="createDate"/>
      </el-table>
<!--      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />-->
    </div>
  </el-dialog>
</template>

<script>
import {pageListAll,updateBourn} from "@/api/product/bourn"
import {pageListAll as areaList} from "@/api/system/tourArea"
import {pageListAll as orgList} from "@/api/system/organization"

export default {
  name: "bournlog",
  components: {},
  data() {
    return {
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      visible: false,
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 表格数据
      tableData: [],
      updateInfo:{
        productId: '',
        list:[]
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        state: 2,
        productId: '',
      },
    }
  },
  created() {
    //this.getList()
  },
  methods: {
    open(productId) {
      this.loading=true
      this.queryParams.productId=productId
      this.visible = true
      this.title = "地接社列表"
      this.getList()
    },
    getList() {
      this.loading = true
      pageListAll(this.queryParams).then(response => {
          this.tableData = response.rows
          this.total = response.total
        this.loading=false
        }
      )
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    changOrg(index,org) {
      this.$set(this.tableData[index],"bournReception",org.orgName)
      this.$set(this.tableData[index],"linkman",org.linkMan)
      this.$set(this.tableData[index],"linktel",org.linkTel)
      this.$set(this.tableData[index],"licence",org.licenseKey)
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
  }
}
</script>
